package domain.aspects;

import org.aspectj.lang.ProceedingJoinPoint;

public class TestAspect {
	public Integer addContactFromParis(
			ProceedingJoinPoint pjp,
			final String firstName, final String lastName,
			final String email, final String street, final String city, 
			final String zip, final String country,
			final String mobile, final String house, final String work, String[] contactgroups) 
					throws Throwable {

		if("france".compareTo(country.toLowerCase()) == 0 && 
				"paris".compareTo(city.toLowerCase()) == 0) {
			return (Integer) pjp.proceed();
		}
		else {
			return (Integer)pjp.proceed(
					new Object[] 
							{ 
							firstName, lastName, email, street, 
							"No_Where_City", zip, "No_Where_Country", mobile, 
							house, work, contactgroups 
							});
		}
	}
}
